<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
    <button @click="fn">点我</button>
    <p ref="myP">ref</p>
</div>
</body>
<script>
    new Vue({
        el : '#root',
        methods:{
            fn(){
                this.$refs.myP.style.color = 'pink';
                this.$refs.myP.innerText = 'dcl'
            }
        }
    })
</script>
</html>